package com.gouying.mall.discovery.controller;

import com.gouying.mall.discovery.VmTest;
import lombok.Data;
import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;

@RefreshScope
@RestController
public class WebController {

    @Value("${name:1}")
    private String name;

    @Value("${spring.datasource.username:12}")
    private String username;



    @GetMapping("/index1")
    public List<VmTest> index(@RequestParam(value = "red",required = false) String red, HttpServletRequest request){
        long start = System.currentTimeMillis();
        List<VmTest> vmTests = new ArrayList<>();
        long end = System.currentTimeMillis();
        System.out.println((end - start));
        return vmTests;
    }


}
